import request from '@/utils/request'

// 发表文章
export function publishArticle(data)  {
    return request({
        url: '/admin/article/publish',
        method:'post',
        data
    })
}

// 更新文章
export function updateArticle(data)  {
    return request({
        url: '/admin/article/update',
        method:'post',
        data
    })
}

// 置顶/取消置顶文章
export function setArticleTop(params)  {
    return request({
        url: '/admin/article/setTop',
        method:'post',
        params
    })
}

// 文章列表分页查询
export function queryArticlePage(data)  {
    return request({
        url: 'admin/article/list',
        method:'post',
        data
    })
}

// 删除文章
export function delArticleById(params)  {
    return request({
        url: 'admin/article/delById',
        method:'post',
        params
    })
}

// 根据id获取文章
export function getArticleById(params)  {
    return request({
        url: 'admin/article/getArticleById',
        method:'post',
        params
    })
}
